package cn.secby.orders.service.impl;
import cn.secby.common.core.web.mapper.WrapperParse;
import java.util.List;
import cn.secby.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.secby.orders.mapper.OrderMapper;
import cn.secby.orders.domain.Order;
import cn.secby.orders.service.IOrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Arrays;

/**
 * 订单Service业务层处理
 * @author shenkunlin
 * @date 2025-05-06
 */
@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements IOrderService
{
    @Autowired
    private OrderMapper orderMapper;

    /**
     * 查询订单
     * @param id 订单主键
     * @return 订单
     */
    @Override
    public Order selectOrderById(Long id)
    {
        return getById(id);
    }

    /**
     * 查询订单列表
     * @param order 订单
     * @return 订单
     */
    @Override
    public List<Order> selectOrderList(Order order)
    {
        return list(WrapperParse.query(order));
    }

    /**
     * 新增订单
     * @param order 订单
     * @return 结果
     */
    @Override
    public Boolean insertOrder(Order order)
    {
        return save(order);
    }

    /**
     * 修改订单
     * @param order 订单
     * @return 结果
     */
    @Override
    public Boolean updateOrder(Order order)
    {
        return updateById(order);
    }

    /**
     * 批量删除订单
     * @param ids 需要删除的订单主键
     * @return 结果
     */
    @Override
    public Boolean deleteOrderByIds(List<Long> ids)
    {
        return removeByIds(ids);
    }

    /**
     * 删除订单信息
     * @param id 订单主键
     * @return 结果
     */
    @Override
    public Boolean deleteOrderById(Long id)
    {
        return removeById(id);
    }
}
